/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.exobject;

import java.math.BigDecimal;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author layton
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        exObject myobj2 = new exObject(new Integer(2));

        int i = -1;
        float f = (float)i;
        System.out.println(i);
        System.out.println(BigDecimal.valueOf(f));

        System.exit(0);
        System.out.println("Testing real nulltype");
        exObject myobj = new exObject(null);
        try {
            exObject newobj = myobj.clone();
            System.out.println(newobj.toDetailedString());
            if(newobj.equals(myobj)){
                System.out.println("newobj.equals(myobj) is true");
            } else {
                System.out.println("newobj.equals(myobj) is false");
            }
            if(myobj.equals(newobj)){
                System.out.println("myobj.equals(newobj) is true");
            } else {
                System.out.println("myobj.equals(newobj) is false");
            }
        } catch (CloneNotSupportedException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        }
        System.out.println("Testing File object type");
        myobj = new exObject(new java.io.File("/"));
        try{
            //Files don't support clone
            exObject newobj = myobj.clone();
            System.out.println("Exception should have been thrown!");
        } catch(CloneNotSupportedException ex){
            System.out.println("Exception thrown correctly when cloning a File.");
        }
        System.out.println(myobj.toDetailedString());

        myobj = new exObject(new java.util.ArrayList());
        try{
            //ArrayLists do support cloning
            exObject newobj = myobj.clone();
            System.out.println("Clone of ArrayList: " + newobj.toDetailedString());
        } catch(CloneNotSupportedException ex){
            System.out.println("Uh oh, it should have cloned the ArrayList.");
        }

        System.out.println("Testing Strings");
        myobj = new exObject("A string");
        try{
            exObject newobj = myobj.clone();
            System.out.println("Clone of String: " + newobj.toDetailedString());
        } catch(CloneNotSupportedException ex){
            System.out.println("Uh oh, it should have cloned the String.");
        }

        System.out.println("Testing void");
        myobj = exObject.getVoidType();
        try{
            exObject newobj = myobj.clone();
            System.out.println("Clone of void: " + newobj.toDetailedString());
        } catch(CloneNotSupportedException ex){
            System.out.println("Uh oh, it should have cloned the void");
        }

        System.out.println("Testing ints");
        myobj = new exObject(2);
        System.out.println("Testing conversion to float: " + myobj.getAsType(Classification.FLOAT).toDetailedString());
    }

    static void function(Object o){

    }
    static void function(String s){

    }
    static void function(long l){

    }
    static void function(int i){

    }

}
